import React from 'react';
import {HashRouter as Router, Redirect, Route, Switch} from "react-router-dom";
import Loader from "./components/loader";
import NotFound from "./pages/error/nouFound";
import './App.less';
import Login from "./pages/manage/login";

const ManageIndex = Loader(() => import("./pages/manage"));

const App = () => {

    return (
        <div className="app">
            <Router>
                <Switch>
                    <Route exact path="/" render={() => <Redirect to="/manage/home"/>}/>
                    <Route exact path="/manage/login" component={Login}/>
                    <Route exact path="/404" component={NotFound}/>
                    <Route path="/manage" component={ManageIndex}/>
                    <Route render={() => <Redirect to="/404"/>}/>
                </Switch>
            </Router>
        </div>
    );
}

export default App;
